<template>
  <div class="app-container">
    <el-select v-model="filters.clientType" placeholder="请选择操作端">
      <el-option
        v-for="item in consts.PAYMENT_PLATFORM"
        :label="item.title"
        :key="item.value"
        :value="item.value"
      ></el-option>
    </el-select>
    <el-table border :data="tableData" v-loading="loading" element-loading-text="加载中..."
              class="el-table-align-center">
      <el-table-column label="序号" type="index" width="80px" align="center"></el-table-column>
      <el-table-column label="三方支付名称" prop="paymentName" align="center">
      </el-table-column>

      <el-table-column label="应用端" prop="channelName" align="center">
        <template slot-scope="{row}">
          {{row.clientType | toConverter('PAYMENT_PLATFORM')}}
        </template>
      </el-table-column>
    </el-table>
    <el-table-column label="商户号" prop="no" width="80px" align="center"></el-table-column>
    <el-table-column label="入款成功率" prop="successRate" align="center">
       <template slot-scope="{row}">
         {{row.successRate/100 | currency}}%
       </template>
      </el-table-column>
     <el-table-column label="当日出上限" prop="dailyLimit" align="center"></el-table-column>
      <el-table-column label="今日已出款总额" prop="successTotal" align="center"></el-table-column>
     <el-table-column label="轮替状态" prop="" align="center">
        <template slot-scope="{row}">
          {{row.dailyLimit > row.successTotal ? '使用中' :'已停用'}}
        </template>
      </el-table-column>
  </div>
</template>


<script>
  import {paymentWithdrawDetail} from "@/services/api/payment";
  import {grid, form, dialog} from '@/build'

  export default {
    name: "withdraw-payment-merchant",
    components: {},
    mixins: [grid, form, dialog],
    props: {
      paymentId:{
        type: Number,
      },
      levelId:{
        type: Number,
      }
    }
    ,
    data() {
      return {
        levelId: '',
        tableData: [],
        dialogVisible: false,
        paymentManageList: [],
        filters: {
          clientType: 1,
          paymentId: -1,
          levelId: -1,
        }
      }
    },
    methods: {
      changeHandler() {
        this.gridSearch()
      },

    },
    watch:{
      paymentId: ()=> {
        this.filters.paymentId=this.paymentId;
      },
      levelId: ()=> {
        this.filters.levelId=this.levelId;
      },
    },
    mounted() {
      this.bindGet(paymentWithdrawDetail, 'tableData', {
        action: 'getGrid',
        sendingData: 'filters',
      });
      this.getAll();
    }
  }
</script>

<style lang="scss" scoped>
  .el-table-align-center {
    &.el-table {
      width: 100%;
      text-align: center !important;
      th {
        text-align: center !important;
      }
    }
  }

</style>
